function delay(durtion) {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve(); 
    }, durtion);
  });
}

async function main() {
    for (let i = 0; i < 5; i++) {
        await delay(1000);
        console.log("ok"); 
     }
     
}